<?php

namespace app\widgets;

use yii\helpers\Html;
use yii\widgets\LinkPager;

class WebLinkPager extends LinkPager {

    public $nextPageLabel = '下一页';
    public $prevPageLabel = '上一页';
    public $options = ['class' => 'tr pages'];
    public $activePageCssClass = 'cur';
    public $registerLinkTags = TRUE;
    public $summary;

    protected function renderPageButton($label, $page, $class, $disabled, $active) {
        $options = ['class' => empty($class) ? $this->pageCssClass : $class];
        if ($active) {
            Html::addCssClass($options, $this->activePageCssClass);
        }
        if ($disabled) {
//            Html::addCssClass($options, $this->disabledPageCssClass);
//            return Html::tag('a', Html::tag('span', $label), $options);
            return '';
        }
        $linkOptions = $this->linkOptions;
        $linkOptions['data-page'] = $page;

        return Html::a($label, $this->pagination->createUrl($page), $options);
    }
}